package com.jyw.business.de.expand.controller;

import com.jyw.business.de.domain.dto.web.ObsDemandAddDto;
import com.jyw.business.de.expand.domain.dto.DeOrderAddDto;
import com.jyw.business.de.expand.service.IDeObstaclesService;
import com.jyw.common.core.domain.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "需求扩展-报障模块")
@RestController
@RequestMapping("/de/obstacles")
public class DeObstaclesController {

    @Resource
    private IDeObstaclesService obstaclesService;

//    需求转工单

    /**
     * 需求转工单
     * @param orderDto
     * @return
     */
    @PutMapping("transfer/order")
    @PreAuthorize("@ss.hasPermi('de:demand:info:order')")
    @ApiOperation("需求转工单")
    public CommonResult transferOrder(@RequestBody DeOrderAddDto orderDto){
        obstaclesService.transferOrder(orderDto);
        return CommonResult.success();
    }

}
